package cn.rengy.web.excelsearch;

import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;

import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

public class FenCi {

    public static List<String> segment(String text) throws IOException {
        List<String> list = new ArrayList<>();
        StringReader re = new StringReader(text);
        IKSegmenter ik = new IKSegmenter(re, true);
        Lexeme lex;
        while ((lex = ik.next()) != null) {
            String word=lex.getLexemeText();
            if(!"项目".equals(word)
            &&!"发电".equals(word)){
                list.add(word);
            }

        }
        return list;
    }


    public static void main(String[] args) throws IOException {

        List textList=segment("广灵望狐风电场");
        System.out.println(textList);
    }

}

